package org.csu.jpetstoreagain.persistence;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.csu.jpetstoreagain.domain.Product;

import java.util.List;

@Mapper
public interface ProductMapper extends BaseMapper<Product> {

    @Select("SELECT PRODUCTID, NAME, DESCN , CATEGORY " +
            "FROM PRODUCT " +
            "WHERE lower(NAME) LIKE CONCAT('%', #{keywords}, '%')")
    List<Product> searchProductList(String keywords);
}
